package homework;

import java.util.ArrayList;
import java.util.Scanner;

public class RoleserveTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            //hasNext就是还有下一个啊，one by one，接着是下一个，遍历完了就停止；while（true）如果条件跳不出，就是死循环啊。
            String name = scanner.next();
            String desc = scanner.next();
            test.RoleService service = new test.RoleServiceImpl();
            service.addRole(new test.Role(name, desc));
            ArrayList<test.Role> list = service.getRole();
            for (int i = 0 ; i < list.size() ; i++){
                System.out.println(list.get(i).getName()+":"+list.get(i).getDsec());
            }
        }
    }
}
